package gestionColis;

/**
 * Interface definition : GestBancaire
 * 
 * @author OpenORB Compiler
 */
public class _GestBancaireStub extends org.omg.CORBA.portable.ObjectImpl
        implements GestBancaire
{
    static final String[] _ids_list =
    {
        "IDL:gestionColis/GestBancaire:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = gestionColis.GestBancaireOperations.class;

    /**
     * Operation creationCompte
     */
    public void creationCompte(gestionColis.InfoAdherent adherent)
        throws gestionColis.InfoAdherentInvalideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("creationCompte",true);
                    gestionColis.InfoAdherentHelper.write(_output,adherent);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(gestionColis.InfoAdherentInvalideExceptionHelper.id()))
                    {
                        throw gestionColis.InfoAdherentInvalideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("creationCompte",_opsClass);
                if (_so == null)
                   continue;
                gestionColis.GestBancaireOperations _self = (gestionColis.GestBancaireOperations) _so.servant;
                try
                {
                    _self.creationCompte( adherent);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation crediter
     */
    public void crediter(gestionColis.InfoTransaction transaction)
        throws gestionColis.AdherentInconnuException, gestionColis.MontantInvalideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("crediter",true);
                    gestionColis.InfoTransactionHelper.write(_output,transaction);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(gestionColis.AdherentInconnuExceptionHelper.id()))
                    {
                        throw gestionColis.AdherentInconnuExceptionHelper.read(_exception.getInputStream());
                    }

                    if (_exception_id.equals(gestionColis.MontantInvalideExceptionHelper.id()))
                    {
                        throw gestionColis.MontantInvalideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("crediter",_opsClass);
                if (_so == null)
                   continue;
                gestionColis.GestBancaireOperations _self = (gestionColis.GestBancaireOperations) _so.servant;
                try
                {
                    _self.crediter( transaction);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation debiter
     */
    public void debiter(gestionColis.InfoTransaction transaction)
        throws gestionColis.AdherentInconnuException, gestionColis.MontantInvalideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("debiter",true);
                    gestionColis.InfoTransactionHelper.write(_output,transaction);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(gestionColis.AdherentInconnuExceptionHelper.id()))
                    {
                        throw gestionColis.AdherentInconnuExceptionHelper.read(_exception.getInputStream());
                    }

                    if (_exception_id.equals(gestionColis.MontantInvalideExceptionHelper.id()))
                    {
                        throw gestionColis.MontantInvalideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("debiter",_opsClass);
                if (_so == null)
                   continue;
                gestionColis.GestBancaireOperations _self = (gestionColis.GestBancaireOperations) _so.servant;
                try
                {
                    _self.debiter( transaction);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation verificationSolde
     */
    public void verificationSolde(gestionColis.InfoTransaction transaction)
        throws gestionColis.AdherentInconnuException, gestionColis.MontantInvalideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("verificationSolde",true);
                    gestionColis.InfoTransactionHelper.write(_output,transaction);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(gestionColis.AdherentInconnuExceptionHelper.id()))
                    {
                        throw gestionColis.AdherentInconnuExceptionHelper.read(_exception.getInputStream());
                    }

                    if (_exception_id.equals(gestionColis.MontantInvalideExceptionHelper.id()))
                    {
                        throw gestionColis.MontantInvalideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("verificationSolde",_opsClass);
                if (_so == null)
                   continue;
                gestionColis.GestBancaireOperations _self = (gestionColis.GestBancaireOperations) _so.servant;
                try
                {
                    _self.verificationSolde( transaction);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
